home *** CD-ROM | disk | FTP | other *** search
/ Professional Soft Collection 1.02 / Professional Soft Collection 1.02.iso / communic / qmodempr / script.pak / MSI-MAIL.SCR < prev    next >
Encoding:
Text File  |  1994-03-01  |  2.4 KB  |  88 lines

  1. '********************************************************************
  2. '
  3. ' This script calls MSI HQ BBS and uploads and downloads mail using
  4. ' the Tomcat mail door online.
  5. '
  6. '********************************************************************
  7.  
  8. ' Set up a when on "-Pause-" to take care of the case where the sysop has
  9. ' a prelog screen with a pause in it.
  10.  
  11. when match "-Pause-" do send
  12.  
  13. ' Wait for name and password prompts and send the correct responses.
  14.  
  15. waitfor "first name"
  16. send lastconnectuserid
  17. waitfor "password"
  18. send lastconnectpassword
  19.  
  20. ' Set up a number of match type whens to provide answers to various prompts
  21. ' and so on.
  22.  
  23. when match "] to continue" do send
  24. when match "view the bulletin menu" do send "N"
  25. when match "have new personal mail" do send "C"
  26. when match "protocol menu [" do send "Z"
  27.  
  28. ' A when quiet is used to press Enter whenever we don't get any characters
  29. ' for a particular amount of time (10 seconds in this case)
  30.  
  31. when quiet 10 do send
  32.  
  33. ' Set the default timeout to 60 seconds - if we don't get what we're looking
  34. ' for then just abort (below in the "catch err_timeout" section)
  35.  
  36. timeout 60
  37.  
  38. ' Make our way to the Tomcat main menu
  39.  
  40. waitfor "command"
  41. send "M"
  42. waitfor "command"
  43. send "T"
  44. waitfor "tomcat menu ["
  45.  
  46. ' Now we're at the Tomcat main menu.  Check to see if we have a REP file
  47. ' to upload.  If so, go ahead and send it up.
  48.  
  49. if exists(ConfigUploadPath+"\mustang.rep") then
  50.   send "U"
  51.   waitfor "now"
  52.   if upload(ConfigUploadPath+"\mustang.rep", Zmodem) = 0 then
  53.     del ConfigUploadPath+"\mustang.rep"
  54.   end if
  55.   waitfor "tomcat menu ["
  56. end if
  57.  
  58. ' Now download the new mail.  We will provide a timeout of 200 seconds
  59. ' on the 'waitfor' that waits for the prompt at the end of the scan,
  60. ' that way if this takes a long time we won't just abort.
  61.  
  62. send "D"
  63. waitfor "would you like", 200
  64.  
  65. ' Respond to the download prompt and download the file
  66.  
  67. send "Y"
  68. waitfor "now", 120
  69. del ConfigDownloadPath+"\mustang.qwk"
  70. call download(ConfigDownloadPath, Zmodem)
  71.  
  72. ' Wait for Tomcat to return to its menu and send the command to log off.
  73.  
  74. waitfor "tomcat menu ["
  75. send "G"
  76.  
  77. ' At this point the script will end and return to terminal mode.
  78.  
  79. end
  80.  
  81. ' This is a catch clause for the main program body, it handles timeout
  82. ' errors that are not otherwise handled.  If we get a timeout here, then
  83. ' there's not much we can do so we just hang up and abort.
  84.  
  85. catch err_timeout
  86.   hangup
  87.   end
  88.